package lab02.Test03;

/**
 * Created by lenovo on 2017/10/12.
 */
public class Student {
    //1 属性：计算机成绩、数学成绩、英语成绩
    float computersScore;
    float mathScore;
    float englishScore;
    //2、行为:3、 求总分、平均分、最高分、最低分，并且可以输出一个学生的完整信息。
     float sum(){
        return  computersScore+mathScore+englishScore;
     }
     float average(){
         return (computersScore+mathScore+englishScore)/3;
     }
     float max(){
         float max=computersScore>mathScore?computersScore:mathScore;
         max=max>englishScore?max:englishScore;
         return max;
     }
     float min(){
        float min=computersScore<mathScore?computersScore:mathScore;
         min=min<englishScore?min:englishScore;
         return min;
     }
     void printStudent(){
         System.out.println("计算机成绩："+computersScore);
         System.out.println("数学成绩："+mathScore);
         System.out.println("英语成绩："+englishScore);
         System.out.println("总分："+sum());
         System.out.println("平均分："+average());
         System.out.println("最大值："+max());
         System.out.println("最小值："+min());
     }


    public static void main(String[] args) {

    }
    //3、构造函数


    //4、main函数
}
